VERSION 5.00
Object = "{753FEE6F-A545-4EAA-AAC8-87512ED29F21}#3.0#0"; "ccrpDtp6.ocx"
Begin VB.Form frmDiasNoLaborablesBorrar 
   BackColor       =   &H00FFFFFF&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Borrar Dia No Laborable"
   ClientHeight    =   2280
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4335
   ControlBox      =   0   'False
   Icon            =   "frmDiasNoLaborablesBorrar.frx":0000
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2280
   ScaleWidth      =   4335
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton cmdBorrar 
      Appearance      =   0  'Flat
      BackColor       =   &H00FFFFFF&
      Caption         =   "&Borrar"
      Height          =   390
      Left            =   600
      MaskColor       =   &H00FFFFFF&
      Style           =   1  'Graphical
      TabIndex        =   4
      ToolTipText     =   "Entrar al sistema (F5)"
      Top             =   1800
      Width           =   1140
   End
   Begin VB.CommandButton cmdCancel 
      Appearance      =   0  'Flat
      BackColor       =   &H00FFFFFF&
      Cancel          =   -1  'True
      Caption         =   "&Cancelar"
      Height          =   390
      Left            =   2640
      MaskColor       =   &H00FFFFFF&
      Style           =   1  'Graphical
      TabIndex        =   5
      ToolTipText     =   "Salir (Esc)"
      Top             =   1800
      Width           =   1140
   End
   Begin VB.Frame Frame1 
      BackColor       =   &H00FFFFFF&
      Caption         =   "Por"
      Height          =   1575
      Left            =   120
      TabIndex        =   6
      Top             =   120
      Width           =   4095
      Begin VB.OptionButton optFec 
         BackColor       =   &H00FFFFFF&
         Caption         =   "Rango de fechas"
         Height          =   255
         Index           =   1
         Left            =   2040
         TabIndex        =   1
         Top             =   360
         Width           =   1935
      End
      Begin VB.OptionButton optFec 
         BackColor       =   &H00FFFFFF&
         Caption         =   "Fecha Actual"
         Height          =   255
         Index           =   0
         Left            =   240
         TabIndex        =   0
         Top             =   360
         Width           =   1815
      End
      Begin CCRPDTP6.ccrpDtp cmbFec1 
         Height          =   315
         Left            =   120
         TabIndex        =   2
         Top             =   1080
         Visible         =   0   'False
         Width           =   1575
         _ExtentX        =   2778
         _ExtentY        =   556
         CustomFormat    =   "dd/MM/yyyy"
         Min             =   36526
         Max             =   219512
         CCRPVer         =   1
         Var             =   "frmDiasNoLaborablesBorrar.frx":08CA
         XD              =   "frmDiasNoLaborablesBorrar.frx":08FE
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Text            =   "06/05/2010"
      End
      Begin CCRPDTP6.ccrpDtp cmbFec2 
         Height          =   315
         Left            =   2040
         TabIndex        =   3
         Top             =   1080
         Visible         =   0   'False
         Width           =   1575
         _ExtentX        =   2778
         _ExtentY        =   556
         CustomFormat    =   "dd/MM/yyyy"
         Min             =   36526
         Max             =   219512
         CCRPVer         =   1
         Var             =   "frmDiasNoLaborablesBorrar.frx":095A
         XD              =   "frmDiasNoLaborablesBorrar.frx":098E
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Text            =   "06/05/2010"
      End
      Begin VB.Label lblFec1 
         BackColor       =   &H00FFFFFF&
         Caption         =   "Desde:"
         Height          =   255
         Left            =   120
         TabIndex        =   8
         Top             =   840
         Visible         =   0   'False
         Width           =   1575
      End
      Begin VB.Label lblFec2 
         BackColor       =   &H00FFFFFF&
         Caption         =   "Hasta:"
         Height          =   255
         Left            =   2040
         TabIndex        =   7
         Top             =   840
         Visible         =   0   'False
         Width           =   1575
      End
   End
End
Attribute VB_Name = "frmDiasNoLaborablesBorrar"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private i As Integer
Public fecha As Date, Prof As String

Private Sub cmdBorrar_Click()

If DateDiff("d", cmbFec1.Value, Fecha_Server) > 0 Then
    MsgBox "No puede eliminar una fecha anterior a la actual", vbCritical, "Error Datos"
    Exit Sub
End If

If optFec(0).Value Then
    frmDiasNoLaborables.cTipo = "uno"
    frmDiasNoLaborables.cFec1 = fecha
    frmDiasNoLaborables.cFec2 = fecha
    frmDiasNoLaborables.ok = MsgBox("Seguro que desea borrar el dia no laborable: " & _
                                fecha & vbCrLf & "Prof.: " & Prof, vbCritical + vbYesNo + vbDefaultButton2, "ATENCION")
ElseIf optFec(1).Value Then
    frmDiasNoLaborables.cTipo = "varios"
    frmDiasNoLaborables.cFec1 = cmbFec1.Value
    frmDiasNoLaborables.cFec2 = cmbFec2.Value
    frmDiasNoLaborables.ok = MsgBox("Seguro que desea borrar en el rango de dias no laborable: " & _
                                cmbFec1.Value & " al " & cmbFec2.Value & vbCrLf & "Prof.: " & Prof, vbCritical + vbYesNo + vbDefaultButton2, "ATENCION")
    
End If

Unload Me

End Sub

Private Sub cmdCancel_Click()

frmDiasNoLaborables.ok = 0
Unload Me

End Sub

Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)

If KeyCode = 27 Then cmdCancel_Click

End Sub

Private Sub Form_Load()

Centrar Me

End Sub

Private Sub optFec_Click(Index As Integer)

Me.Caption = "Borrar Dia No Laborable " & fecha
cmbFec1.Value = fecha
cmbFec2.Value = fecha

optFec(Index).FontBold = True

For i = 0 To optFec.UBound
    If i <> Index Then
        optFec(i).FontBold = False
    End If
    DoEvents
Next i

Select Case Index
    Case 0
        lblFec1.Visible = False
        lblFec2.Visible = False
        cmbFec1.Visible = False
        cmbFec2.Visible = False
    Case 1
        lblFec1.Visible = True
        lblFec2.Visible = True
        cmbFec1.Visible = True
        cmbFec2.Visible = True
End Select

End Sub
